<%-- 
    Document   : just_viewed
    Created on : Nov 27, 2011, 4:35:40 PM
    Author     : Ngoc Linh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<c:if test="${not empty SanPhamVuaXem}">
    <div class="sidebar_panel">
        <p class="top_sidebar_panel">
            SẢN PHẨM VỪA XEM
        </p>
        <div class="content_sidebar_panel" id="just_view">
            <c:if test="${not empty sessionScope.SanPhamVuaXem[SanPhamVuaXem.size() - 1]}">
                <div class="product_sidebar_item">
                    <p class="name_pro" >
                        <a href="product.do?masp=${SanPhamVuaXem[SanPhamVuaXem.size() - 1].maSanPham}">
                            <strong>${SanPhamVuaXem[SanPhamVuaXem.size() - 1].tenSanPham}</strong>
                        </a>
                    </p>
                    <a href="product.do?masp=${SanPhamVuaXem[SanPhamVuaXem.size() - 1].maSanPham}">
                        <img src="${SanPhamVuaXem[SanPhamVuaXem.size() - 1].hinhMoTa}" alt="" width="56px" height="58px" />
                    </a>
                    <div class="content_product_sidebar_item">
                        <p class="price_pro">
                            <strong>Giá đấu:</strong> <span>${SanPhamVuaXem[SanPhamVuaXem.size() - 1].giaHienTai} đ</span>
                        </p>
                        <p class="viewed_pro">
                            <strong>Lượt xem:</strong> <span>${SanPhamVuaXem[SanPhamVuaXem.size() - 1].soLuongXem}</span>
                        </p>
                    </div>
                </div>
            </c:if>

            <c:if test="${not empty SanPhamVuaXem[SanPhamVuaXem.size() - 2]}">
                <div class="product_sidebar_item">
                    <p class="name_pro" >
                        <a href="product.do?masp=${SanPhamVuaXem[SanPhamVuaXem.size() - 2].maSanPham}">
                            <strong>${SanPhamVuaXem[SanPhamVuaXem.size() - 2].tenSanPham}</strong>
                        </a>
                    </p>
                    <a href="product.do?masp=${SanPhamVuaXem[SanPhamVuaXem.size() - 2].maSanPham}">
                        <img src="${SanPhamVuaXem[SanPhamVuaXem.size() - 2].hinhMoTa}" alt="" width="56px" height="58px" />
                    </a>
                    <div class="content_product_sidebar_item">
                        <p class="price_pro">
                            <strong>Giá đấu:</strong> <span>${SanPhamVuaXem[SanPhamVuaXem.size() - 2].giaHienTai} đ</span>
                        </p>
                        <p class="viewed_pro">
                            <strong>Lượt xem:</strong> <span>${SanPhamVuaXem[SanPhamVuaXem.size() - 2].soLuongXem}</span>
                        </p>
                    </div>
                </div>
            </c:if>
            
            <p class="see_more">
                <a href="viewed.do"><b>Xem tiếp</b></a>
            </p>
        </div>
    </div>
</c:if>